﻿using CatUtils.Utils.Currency.IoUtils;
using System;
using System.Linq;
using System.Windows.Forms;

namespace RabbitDownload.WebSite.Zerochan
{
    public partial class ZerochanControl : UserControl
    {
        public ZerochanControl()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            new ZerochanLogin().SendPost(textBox1.Text, textBox2.Text);
            new ZerochanScannerTag().StartScanner(richTextBox1.Lines.ToList(), textboxOnlyCount1.Text, textboxOnlyCount2.Text, textboxOnlyCount3.Text);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            string FilePath = FileHelper.SelectFile();
            new ZerochanLogin().SendPost(textBox1.Text, textBox2.Text);
            new ZerochanScannerTag().StartWithFile(FilePath, textboxOnlyCount1.Text, textboxOnlyCount2.Text, textboxOnlyCount3.Text);
        }

        private void button3_Click(object sender, EventArgs e)
        {
            new ZerochanLogin().SendPost(textBox1.Text, textBox2.Text, true);
        }

        private void button4_Click(object sender, EventArgs e)
        {
            new ZerochanTag().DownloadTag(textboxOnlyCount4.Text);
        }
    }
}